package spring.ioc;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class IocApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(IocApplication.class, args);
        ServiceA bean = (ServiceA) applicationContext.getBean("serviceA");
        bean.sayA();
        bean.sayB();
//        ServiceB bean2 = (ServiceB) applicationContext.getBean("serviceB");
//        System.out.println(bean2);
    }

}
